import http from "./request.ts"

// flash/list 根据活动名称分页查询
export const flashList = (params: IFlashListParams): RES<IFlashListModel> => http.get("/flash/list", { params })
// flash/update/status/{id} 修改上下线状态
export const flashUpdateStatus = (params: { id: number, status: number }): RES<IFlashResponse> => http.post(`/flash/update/status/${params.id}?status=${params.status}`)

// flash/create 添加活动
export const flashCreate = (params: IFlashCreateParams): RES<IFlashResponse> => http.post(`/flash/create`, params)
// flash/update/{id} 编辑活动
export const flashUpdateById = (params: IFlashCreateParams): RES<IFlashResponse> => http.post(`/flash/update/${params.id}`, params)

// flash/delete/{id} 删除活动
export const flashDeleteId = (ids: number): RES<IFlashResponse> => http.post(`/flash/delete/${ids}`)